package com.devinlee.designpatterns.factory.factory_method;

import com.devinlee.designpatterns.factory.factory_method.car.Car;
import com.devinlee.designpatterns.factory.factory_method.factory.BMWFactory;
import com.devinlee.designpatterns.factory.factory_method.factory.BugattiFactory;

/**
 * 工厂模式-测试
 *
 * 三种工厂模式特点：
 * 简单工厂模式：只有一个工厂，只生产一种产品
 * 工厂模式：多个工厂，只生产一种产品
 * 抽象工厂模式：多个工厂，而且生产多种产品
 */
public class Demo {

    public static void main(String[] args) {

        BMWFactory bmwFactory = new BMWFactory();
        Car car1 = bmwFactory.create();
        car1.didi();

        BugattiFactory bugattiFactory = new BugattiFactory();
        Car car2 = bugattiFactory.create();
        car2.didi();
    }
}
